import 'package:flutter/material.dart';
import 'package:flutter_demo/input/input_demo.dart';
import 'package:flutter_demo/router/router_demo.dart';
import 'package:flutter_demo/widget/container/decorated_demo.dart';
import 'package:flutter_demo/widget/container/flex_demo.dart';

import 'http/http_demo.dart';
import 'lifecycle/lifecycle_demo.dart';

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("flutter例子"),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            MaterialButton(
              child: Text("生命周期"),
              onPressed: () {
                Navigator.push(
                  context,
                  new MaterialPageRoute(
                      builder: (context) => new LifecycleDemo()),
                );
              },
            ),
            RaisedButton(
              child: Text("页面跳转"),
              onPressed: () {
                Navigator.push(
                  context,
                  new MaterialPageRoute(builder: (context) => new RouterDemo()),
                );
              },
            ),
            RaisedButton(
              child: Text("http"),
              onPressed: () {
                Navigator.push(
                  context,
                  new MaterialPageRoute(builder: (context) => new HttpDemo()),
                );
              },
            ),
            RaisedButton(
              child: Text("input"),
              onPressed: () {
                Navigator.push(
                  context,
                  new MaterialPageRoute(builder: (context) => new InputDemo()),
                );
              },
            ),
            Text("容器"),
            Wrap(
              children: <Widget>[
                RaisedButton(
                  child: Text("widget"),
                  onPressed: () {
                    Navigator.push(
                      context,
                      new MaterialPageRoute(
                          builder: (context) => DecoratedDemo()),
                    );
                  },
                ),
                RaisedButton(
                  child: Text("flex"),
                  onPressed: () {
                    Navigator.push(
                      context,
                      new MaterialPageRoute(builder: (context) => FlexDemo()),
                    );
                  },
                ),
              ],
            )
          ],
        ),
      ),
    );
  }
}
